#include "result.hpp"
#include "Task.hpp"
Result::Result(std::shared_ptr<Task> task, bool isValid) :task_(task), isValid_(isValid) {
	task_->setResult(this);
};
Any Result::get()
{
	if (!isValid_)
	{
		return "";
		LOG_INFO("RESULT::GET>> ISVALID ");
	}
	semo_.wait();
	return std::move(any_);
}

//set the result
void Result::set(Any any)
{
	this->any_ = std::move(any);
	semo_.post();
}